<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>父子组件通信</title>
</head>
<body>
<div id="app">
    <h1>父：{{content}}</h1>
    <com :hont="title" :fu.sync="content"></com>
</div>
<template id="com">
        <div>
            <h2>子：{{hont}}</h2>
            <button @click="dianji">子传父</button>
        </div>
</template>
<script src="../vue.js"></script>
<script>
    var com = {
        props:['hont'],
        template:'#com',
        methods:{
            dianji(){
                this.$emit('update:fu','第三方高德')
            }
        }
    };
    new Vue({
        el:'#app',
        data(){
            return {
                title:'房子',
                content:''
            }
        },
        components:{
            com,
        }
    })
</script>
</body>
</html>